home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 3 / BBS in a box - Trilogy III.iso / Files / System7 tools / Frontier / Frontier SDK 2.1 / Toolkits / IAC Tools / iacrgb.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-06-09  |  1.6 KB  |  78 lines  |  [TEXT/KAHL]

  1.  
  2. /*© Copyright 1988-1993 UserLand Software, Inc.  All Rights Reserved.*/
  3.  
  4. #include "iacinternal.h"
  5.  
  6.  
  7. #define typeRGBColor 'cRGB'
  8.  
  9.  
  10.  
  11. Boolean IACpushRGBColorparam (RGBColor *x, OSType keyword) {
  12.     
  13.     return (IACpushRGBColoritem (IACglobals.event, x, keyword));
  14.     } /*IACpushRGBColorparam*/
  15.  
  16.  
  17. Boolean IACreturnRGBColor (RGBColor *x) {
  18.  
  19.     return (IACpushRGBColoritem (IACglobals.reply, x, keyDirectObject));
  20.     } /*IACreturnRGBColor*/
  21.  
  22.  
  23. Boolean IACgetRGBColorparam (OSType keyword, RGBColor *val) {
  24.  
  25.     if (!IACgetRGBColoritem (IACglobals.event, keyword, val)) {
  26.     
  27.         IACparamerror (IACglobals.errorcode, "\pRGBColor", keyword);
  28.         
  29.         return (false);
  30.         }
  31.     
  32.     IACglobals.nextparamoptional = false; /*must be reset for each param*/
  33.     
  34.     return (true);
  35.     } /*IACgetRGBColorparam*/
  36.     
  37.  
  38. Boolean IACgetRGBColoritem (AEDescList *list, long n, RGBColor *val) {
  39.     
  40.     register OSErr ec;
  41.     DescType key;
  42.     DescType typeCode;
  43.     Size actualSize;
  44.     
  45.     if ((*list).descriptorType != typeAEList) {
  46.         
  47.         ec = AEGetKeyPtr (list, n, typeRGBColor, &typeCode, (Ptr) val, sizeof (*val), &actualSize);
  48.             
  49.         if (ec != errAEDescNotFound)
  50.             goto done;
  51.         }
  52.  
  53.     ec = AEGetNthPtr (list, n, typeRGBColor, &key, &typeCode, (Ptr)val, sizeof (*val), &actualSize);
  54.     
  55.     done:
  56.     
  57.     IACglobals.errorcode = ec;
  58.     
  59.     return (ec == noErr);
  60.     } /*IACgetRGBColoritem*/
  61.  
  62.  
  63. Boolean IACpushRGBColoritem (AEDescList *list, RGBColor *x, long n) {
  64.     
  65.     register OSErr ec;
  66.     
  67.     if ((*list).descriptorType != typeAEList)
  68.         ec = AEPutKeyPtr (list, n, typeRGBColor, (Ptr) x, sizeof (*x));
  69.     else
  70.         ec = AEPutPtr (list, n, typeRGBColor, (Ptr) x, sizeof (*x));
  71.     
  72.     IACglobals.errorcode = ec;
  73.     
  74.     return (ec == noErr);
  75.     } /*IACpushRGBColoritem*/
  76.  
  77.  
  78.